# This file is part of BlackArch Linux ( https://blackarch.org )
# See COPYING for license details.

pkgbase=python-flask-classy
pkgname=('python2-flask-classy' 'python-flask-classy')
_pkgname=Flask-Classy
pkgver=0.6.10
pkgrel=7
pkgdesc='Class based views for Flask.'
arch=('any')
url='https://pypi.org/project/Flask-classy/#files'
makedepends=('python2-setuptools' 'python-setuptools')
license=('BSD')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('3167a52f431afc09a71968916de1e105604bb8fc91ce31c8ccd67f7b2a6a5b56edb359e5e8ccd3aa9417221fad29b9c42eef8a6dd2967755cc5b02f45aad228f')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-flask-classy() {
  depends=('python2' 'python2-flask')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-flask-classy() {
  depends=('python' 'python-flask')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

